#include<iostream>
using namespace std;
long long sum;
int main()
{
	int n;
	cin >> n;
	while (n--)
	{
		sum = 0;
		int k;
		cin >> k;
		for (int i = 0; i < k; i++)
		{
			int a;
			cin >> a;
			sum += a;
		}
		if (n != 0)
		{
			cout << sum << endl;
			cout << endl;
		}
		else
		{
			cout << sum << endl;
		}
	}
	return 0;
}